<template>
  <!-- 科室医师工作量 -->
  <div>
    <h1>住院分科工作量报表</h1>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="kbjc" label="科别" align="center" width></el-table-column>
      <el-table-column prop="qmcws" label="期末实有病床" align="center" width></el-table-column>
      <el-table-column prop="qcs" label="期初原有人数" align="center" width></el-table-column>
      <el-table-column prop="z03" label="入院人数" align="center" width></el-table-column>
      <el-table-column prop="z04" label="他科转入人数" align="center" width></el-table-column>
      <el-table-column label="出院人数" align="center" width>
        <el-table-column prop="z05" label="合计" align="center" width></el-table-column>
        <el-table-column prop label="出院病人数" align="center" width>
          <el-table-column prop="z06" label="小计" align="center" width></el-table-column>
          <el-table-column prop="z07" label="治愈" align="center" width></el-table-column>
          <el-table-column prop="z08" label="好转" align="center" width></el-table-column>
          <el-table-column prop="z09" label="未愈" align="center" width></el-table-column>
          <el-table-column prop="z10" label="死亡" align="center" width></el-table-column>
        </el-table-column>
        <el-table-column prop="z12" label="正常分娩" align="center" width></el-table-column>
        <el-table-column prop="z13" label="计划生育" align="center" width></el-table-column>
        <el-table-column prop="z14" label="其他" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="z15" label="转往他科人数" align="center" width></el-table-column>
      <el-table-column prop="qms" label="期末留院人数" align="center" width></el-table-column>
      <el-table-column prop="z01" label="实际开放总床日数" align="center" width></el-table-column>
      <el-table-column prop="pjkf" label="平均开放病床数" align="center" width></el-table-column>
      <el-table-column prop="z16" label="实际占用总床日数" align="center" width></el-table-column>
      <el-table-column prop="z17" label="出院者占用总床日数" align="center" width></el-table-column>
      <el-table-column prop="z19" label="陪伴人数" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { inpatientWorkload } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: []
    };
  },
  created() {
    this.getTableList(this.dateList.dateBegin, this.dateList.dateEnd);
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        inpatientWorkload({
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            showOkMsg(res.msg);
            this.tableData = res.data;
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>